package com.hunt.model.app;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;

@AllArgsConstructor
@NoArgsConstructor
@ToString
public class StockHolder {
    private String id;
    private String f0;
    private String f1;
    private String stockCode;
    private String name;
    private int shareHolderNow;
    private int shareHolderLast;
    private float monthOnMonth;
    private float priceChange;
    private int perCapita;
    private float top10Hold;
    private float top10HoldPercent;
    private float f11;
    private float f12;
    private float fundHold;
    private float fundHoldPercent;
    private String stockName;
    private String qPercent;
    private String qChange;
    private String bPercent;
    private String bChange;
    private String sPercent;

    public String getoPercent() {
        if(this.oPercent==null){
            return "0";
        }
        return oPercent;
    }

    public void setoPercent(String oPercent) {

        this.oPercent = oPercent;
    }

    private String sChange;
    private String iPercent;
    private String iChange;
    private String tPercent;
    private String tChange;
    private String oPercent;
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getF0() {
        return f0;
    }

    public void setF0(String f0) {
        this.f0 = f0;
    }

    public String getF1() {
        return f1;
    }

    public void setF1(String f1) {
        this.f1 = f1;
    }

    public String getStockCode() {
        return stockCode;
    }

    public void setStockCode(String stockCode) {
        this.stockCode = stockCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getShareHolderNow() {
        return shareHolderNow;
    }

    public void setShareHolderNow(int shareHolderNow) {
        this.shareHolderNow = shareHolderNow;
    }

    public int getShareHolderLast() {
        return shareHolderLast;
    }

    public void setShareHolderLast(int shareHolderLast) {
        this.shareHolderLast = shareHolderLast;
    }

    public float getMonthOnMonth() {
        return monthOnMonth;
    }

    public void setMonthOnMonth(float monthOnMonth) {
        this.monthOnMonth = monthOnMonth;
    }

    public float getPriceChange() {
        return priceChange;
    }

    public void setPriceChange(float priceChange) {
        this.priceChange = priceChange;
    }

    public int getPerCapita() {
        return perCapita;
    }

    public void setPerCapita(int perCapita) {
        this.perCapita = perCapita;
    }

    public float getTop10Hold() {
        return top10Hold;
    }

    public void setTop10Hold(float top10Hold) {
        this.top10Hold = top10Hold;
    }

    public float getTop10HoldPercent() {
        return top10HoldPercent;
    }

    public void setTop10HoldPercent(float top10HoldPercent) {
        this.top10HoldPercent = top10HoldPercent;
    }

    public float getF11() {
        return f11;
    }

    public void setF11(float f11) {
        this.f11 = f11;
    }

    public float getF12() {
        return f12;
    }

    public void setF12(float f12) {
        this.f12 = f12;
    }

    public float getFundHold() {
        return fundHold;
    }

    public void setFundHold(float fundHold) {
        this.fundHold = fundHold;
    }

    public float getFundHoldPercent() {
        return fundHoldPercent;
    }

    public void setFundHoldPercent(float fundHoldPercent) {
        this.fundHoldPercent = fundHoldPercent;
    }

    public String getStockName() {
        return stockName;
    }

    public void setStockName(String stockName) {
        this.stockName = stockName;
    }


    public void setqPercent(String qPercent) {
        this.qPercent = qPercent;
    }

    public Float getqPercent() {
        if(this.qPercent!=null){
            return BigDecimal.valueOf(Float.valueOf(this.qPercent)).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

        }else {
            return 0f;
        }
    }

    public String getqChange() {
        return qChange;
    }

    public void setqChange(String qChange) {
        this.qChange = qChange;
    }

    public Float getbPercent() {
        if(bPercent!=null){
            return BigDecimal.valueOf(Float.valueOf(this.bPercent)).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

        }else {
            return  0f;
        }
    }

    public void setbPercent(String bPercent) {
        this.bPercent = bPercent==null||bPercent.equals("")?"0":bPercent;
    }

    public String getbChange() {
        return bChange;
    }

    public void setbChange(String bChange) {
        this.bChange = bChange;
    }

    public Float getsPercent() {
        if(sPercent!=null){
            return BigDecimal.valueOf(Float.valueOf(this.sPercent)).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

        }else {
            return 0f;
        }
    }

    public void setsPercent(String sPercent) {
        this.sPercent = sPercent;
    }

    public String getsChange() {
        return sChange;
    }

    public void setsChange(String sChange) {
        this.sChange = sChange;
    }

    public Float getiPercent() {
        if(this.iPercent!=null){
            return BigDecimal.valueOf(Float.valueOf(this.iPercent)).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

        }else {
            return 0f;
        }
    }

    public void setiPercent(String iPercent) {
        this.iPercent = iPercent;
    }

    public String getiChange() {
        return iChange;
    }

    public void setiChange(String iChange) {
        this.iChange = iChange;
    }

    public Float gettPercent() {
        if(this.tPercent!=null){
            return BigDecimal.valueOf(Float.valueOf(this.tPercent)).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();

        }else {
            return  0f;
        }
    }

    public void settPercent(String tPercent) {
        this.tPercent = tPercent;
    }

    public String gettChange() {
        return tChange;
    }

    public void settChange(String tChange) {
        this.tChange = tChange;
    }
}
